Repository navigation
perf: fold identical code when linking the optimized runtime - #2106
Conversation
Link the optimized runtimes with -Wl,--icf=all. libNativeScript.so (arm64) drops from 27.3 MB to 24.5 MB, and the optimized-with-inspector one from 28.3 MB to 25.4 MB. --icf=safe folds nothing, because the V8 objects have no address-significance tables.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Description
Links the optimized runtimes (
-Poptimized,-PoptimizedWithInspector) with-Wl,--icf=all, so lld folds identical functions into one copy. No V8 rebuild is needed.libNativeScript.so, arm64--icf=safefolds nothing for this build. It only folds functions whose address is known not to be taken, and V8's objects carry no address-significance tables.With
--icf=all, two identical functions can end up at the same address. Code that compares function pointers for identity would break. The full test suite doesn't show any such dependency.Also checked: uncompressed dex. I looked at whether the app template should store
classes.dexuncompressed, so the installed app doesn't keep an extracted copy. For App Bundle installs it's already uncompressed: in the device split APKs generated from a release AAB for an API 33 arm64 phone,classes.dexis stored (base-master). So this PR doesn't change the dex packaging.Does your commit message include the wording below to reference a specific issue in this repo?
No issue.
Related Pull Requests
None.
Does your pull request have unit tests?
No new tests; this is a link flag.
native-crash-on-alien-threadfromUncaughtErrorPolicyTestappears in both.debug.ns.jnibench, optimized release, Galaxy S20 FE, alternating builds): neutral within the phone's clock-state noise. A few rows moved ±3–10% in both directions between runs.Summary by CodeRabbit